package edu.umassd.raddacl;

import edu.umassd.raddacl.calc.LoopAndCompareAlgorithm;

/**
 * <p>
 * A DataSet is essentially a collection of {@link Observation tuples},
 * encompassing an entire set of data.
 * </p>
 * 
 * <p>
 * A {@link DataSet} is essentially laid out like a matrix. The rows of the
 * DataSet represent an observation, and the columns represent a particular
 * attribute of an observation.
 * </p>
 * 
 * <p>
 * The goal is to take this raw set of observations, and determine which set of
 * observations should be grouped together.
 * </p>
 * 
 * @author Dan Avila
 * 
 */
public interface DataSet extends Iterable<Observation>
{
	/**
	 * Get an observation currently held in this dataset.
	 * 
	 * @param index
	 *            - the index of the observation.
	 * @return the observation we are interested in.
	 */
	Observation getObservation(int index);

	/**
	 * Gets the number of observations held in this dataset.
	 * 
	 * @return the number of observations.
	 */
	int getNumberOfObservations();

	/**
	 * Gets the number of attributes in a given observation.
	 * 
	 * @return the attribute count in an observation.
	 */
	int getNumberOfAttributes();

	/**
	 * Loops over every combination of observations in the dataset, performing a
	 * loop task for each of those combinations.
	 * 
	 * @param loop
	 *            - the combination of loops.
	 */
	void loop(LoopAndCompareAlgorithm loop);

	/**
	 * Sets the content for this dataset.
	 * 
	 * @param data
	 *            - the data representing this dataset.
	 * 
	 */
	void set(double[][] data);

	/**
	 * Converts this dataset into a cluster.
	 * 
	 * @return this dataset as a cluster.
	 */
	Cluster toCluster();
}
